//
// Created by liushuai on 18-7-15.
//

#include <iostream>
#include "Time.h"
Time::Time() {
    hours = 0;
    minuts = 0;
}
Time::Time(int h, int m) {
    hours = h;
    minuts = m;
}
void Time::addhour(int h) {
    hours += h;
}
void Time::addmin(int m) {
    minuts += m;
    if(minuts/60>0)
        hours += 1;
    minuts = minuts%60;
}
void Time::reset(int h, int m) {
    hours = h;
    minuts = m;
}
void Time::show() const {
    using std::cout;
    cout<<"Hour: "<<hours<<" Minut: "<<minuts<<"\n";
}
Time Time::operator+(const Time & t) const {
    Time sum;
    sum.minuts = t.minuts+minuts;
    sum.hours = t.hours+hours+sum.minuts/60;
    sum.minuts = sum.minuts%60;
    return sum;
}
